package networkSimulation.visualisation.gui;

import javax.swing.*;
import java.awt.*;

/**
 * Image panel for visualisation
 *
 * @author  Tim Caljé
 *          Jeroen De Raedt
 *          Jorick Van Aken
 */
class ImagePanel extends JPanel {

  private Image img;

  public ImagePanel(String img) {
    this(new ImageIcon(img).getImage());
  }

  public ImagePanel(Image img) {    
    //this.img = img.getScaledInstance(1000,500,0);
    this.img = img;
    Dimension size = new Dimension(1000,500);      
    setPreferredSize(size);
    setMinimumSize(size);
    setMaximumSize(size);
    setSize(size);
    //setLayout(null);      
  }

  public void paintComponent(Graphics g) {
    g.drawImage(img, 0, 0, null);
  }

}